feature/make-options-agnostic-add-insert-methods#3
Merged
Conversation
Extended DatabaseInterface with InsertOne, InsertMany, and Disconnect methods. Implemented these methods for MongoClient and MockDatabase. Refactored DatabaseOptions to support validation and updated related code and tests for improved flexibility and functionality.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Pull Request: feature/make-options-agnostic-add-insert-methods
Description
This pull request introduces a series of changes aimed at making the database options agnostic and adding insert methods to enhance the flexibility and functionality of the project.
Motivation
Agnostic Database Options:
Databasestruct was tightly coupled withMongoOptions, making it difficult to extend or integrate other types of databases or message queues.DatabaseOptionsinterface, we enable theDatabasestruct to accept any type of options that implement theValidatemethod. This change increases modularity and allows for easier integration with various backends.Addition of Insert Methods:
InsertOneandInsertManymethods to theDatabaseInterfaceand their implementations inMongoClientenhances the CRUD capabilities of the project.Changes
Database Options Interface:
DatabaseOptionsinterface with aValidatemethod.Databasestruct to useDatabaseOptionsinstead ofMongoOptions.Newfunction to handle different types of options by type assertion.Insert Methods in Database Interface:
InsertOneandInsertManymethods to theDatabaseInterface.MongoClient.Mock Database Adjustments:
MockDatabaseto include stubs forInsertOneandInsertManymethods.MongoClient Enhancements:
InsertOneandInsertManymethods.Validatemethod toMongoOptions.Tests:
Impact
DatabaseOptionsinterface.This change significantly improves the project's architecture and functionality, paving the way for future enhancements and integrations.